package com.tnovoselec.android.travelassistant.async;

import java.util.List;
import java.util.concurrent.Callable;

import com.j256.ormlite.dao.Dao;
import com.tnovoselec.android.travelassistant.dto.BankomatDto;

public class InitializeData implements Callable<Boolean>{

    List<BankomatDto> items;
    private Dao<BankomatDto, String> bankomatDao = null;
    
    public InitializeData(List<BankomatDto> items, Dao<BankomatDto, String> bankomatDao){
	super();
	this.items = items;
	this.bankomatDao = bankomatDao;
    }
    
    @Override
    public Boolean call() throws Exception {
	if (bankomatDao != null && items != null && items.size()>0){
	    for (BankomatDto item : items){
		bankomatDao.create(item);
	    }
	    return Boolean.TRUE;
	}
	return Boolean.FALSE;
    }

}
